home *** CD-ROM | disk | FTP | other *** search
- ;;;; Hey Emacs, this script might as well be -*- lisp -*-
- ;;;;
- ;;;; Install AmiTCP - AmiTCP/IP installation script for Installer
- ;;;;
- ;;;; Copyright © 1996 AmiTCP/IP Group,
- ;;;; NSDi - Network Solutions Development Inc., Finland
- ;;;; All rights reserved.
- ;;;;
- ;;;; $Id: Install\040AmiTCP,v 4.5 1996/12/01 17:13:30 too Exp $
- ;;;;
- ;;;; This script has been tested with Installer.
- ;;;;
- ;;;; Installer and Installer project icon
- ;;;; (c) Copyright 1991-93 Commodore-Amiga, Inc. All Rights Reserved.
- ;;;; Reproduced and distributed under license from Commodore.
- ;;;;
- ;;;; INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
- ;;;; NO WARRANTIES ARE MADE. ALL USE IS AT YOUR OWN RISK. NO LIABILITY
- ;;;; OR RESPONSIBILITY IS ASSUMED.
- ;;;;
- ;;;; Use following Icon tooltypes / Command line options:
- ;;;; APPNAME=AmiTCP/IP
- ;;;; MINUSER=AVERAGE
- ;;;;
- ;;;;
- ;;;; What we are?
- ;;;;
- (set app-name (cat @app-name " DialUp 4.5"))
- (set app-dir-name (cat "AmiTCP-DialUp-4.5"))
-
- (welcome " Welcome to the " app-name " installation.\n")
-
- (if (= @pretend 1)
- (set pretend-extra "\nNote: `Make New Drawer' will make new drawer even in PRETEND mode")
- (set pretend-extra ""))
-
- (set
- ;;;;
- ;;;; "Needs"
- ;;;;
- need-version 37 ; version of operating system need by AmiTCP/IP
- need-memory (* 512 1024)
-
- AmiTCP-release-number 4 ; this release
- ;;;
- ;;; Installation disk names
- ;;;
- install-disk1-name "AmiTCP-DialUp-4.5:"
- ;;;
- ;;; Used pkt-files, source-dir will remain on the disk from which the
- ;;; installer was started!
- ;;;
- AmiTCP-pkt-file (tackon install-disk1-name "AmiTCP.pkt")
- Docs-pkt-file (tackon install-disk1-name "AmiTCPDocs.pkt")
- NapsaFonts-pkt-file (tackon install-disk1-name "NapsaFonts.pkt")
- ;;;
- ;;; Other sources on installation disks
- ;;;
- dist-networks-dir (tackon install-disk1-name "Devs/Networks")
- dist-providers-dir (tackon install-disk1-name "providers")
- Installer-file (tackon install-disk1-name "Installer")
- UnPkt-file (tackon install-disk1-name "UnPkt")
- LICENSE-file (tackon install-disk1-name "LICENSE")
- README-FIRST-file (tackon install-disk1-name "Read Me First")
- info.AmiTCPdir-file (tackon install-disk1-name "info.AmiTCPdir")
-
- ;;;
- ;;; Destination directories of the AmiTCP/IP
- ;;;
- atcp-name "AmiTCP"
- atcp-assign (cat atcp-name ":") ; Assign to AmiTCP
- ;; Configuration
- conf-dir (tackon atcp-assign "db")
- ;; User binaries
- bin-dir (tackon atcp-assign "bin")
- ;; documentation
- doc-dir (tackon atcp-assign "doc")
- ;; devices directory
- devs-dir (tackon atcp-assign "devs")
- ;; DOS handlers
- l-dir (tackon atcp-assign "l")
- ;; libraries
- libs-dir (tackon atcp-assign "libs")
- ;; providers
- prov-dir (tackon atcp-assign "providers")
- ;; dialup scrips
- ssrx-dir (tackon atcp-assign "ssrx")
-
- ;;
- ;; The source directory name
- source-dir (if (= 1 (exists @icon))
- (pathonly (expandpath @icon))
- (expandpath @icon))
- ;; Mounts
- apipe-mount (cat
- "Assign APIPE: Exists > NIL:\n"
- "IF Warn\n"
- " Mount APIPE: from AmiTCP:devs/APipe-Mountlist\n"
- "EndIf\n")
- )
- ;; How to get needed information?
- (set
- net-setup-help
- " You can get this information from your network administration.\n")
-
- ;;; copy "more" to ram: to be able to use it
- (set
- pager-cmd
- (if (exists "SYS:Utilities/More" (noreq))
- ((copyfiles
- (prompt "Copying sys:utilities/more to ram: for use")
- (source "SYS:Utilities/More")
- (dest "RAM:")
- (safe)
- (optional "nofail"))
- "RAM:More")
- ("more"))
- )
-
- ;; Return old AmiTCP: assign if we are aborting
- (onerror
- (if old-atcp-directory
- (makeassign atcp-name old-atcp-directory)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- check-system-version
- ;; is your Exec recent enough?
- (set exec-version (/ (getversion) 65536))
- (transcript "Running on exec version " exec-version ".")
- (if (< exec-version need-version) ; check operating system version
- ((transcript "Installation aborted due too old operating system.")
- (abort "AmiTCP/IP requires at least operating system 2.04"))))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- check-available-memory
- ;;
- (transcript "Checking available memory.")
- (set avail-mem (+ (database "total-mem")))
- (if (< avail-mem need-memory)
- ((message "Your system has only " (/ avail-mem 1024) " kilobytes of "
- "free memory, while the " @app-name " needs at least "
- (/ need-memory 1024) " to be useful.\n"
- "You can continue the installation but be warned!")
- (transcript "User decided to continue installation while available "
- "memory was below the recommended minimum."))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- check-user-level
- ;;
- (transcript "Checking user level.")
- (if (< @user-level 1)
- ((transcript "Installation aborted due to too low user level.")
- (abort "AmiTCP/IP installation requires at least the \"average\" "
- "user level. Restart installation and select appropriate user "
- "level."))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- check-old-assign
- ;; If there is already the AmiTCP/IP installed, store the assign
- ;; to old-atcp-directory
- (transcript "Checking for already installed AmiTCP.")
- (set old-atcp-directory
- (if (exists atcp-assign (noreq))
- (getassign atcp-name)
- ""))
- (if old-atcp-directory
- (transcript "Existing AmiTCP detected at directory "
- old-atcp-directory ".")))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (procedure
- check-cpu-type
- (set cpu-type (database "cpu"))
- (set cpu-is-020-or-better
- (AND (<> cpu-type "68000")
- (<> cpu-type "68010")))
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- ask-accept-license ;; Ask if the user accepts license conditions
- (transcript "Asking if the user accepts the license conditions.")
- ;;
- ;; use "more" to show the full license text
- ;;
- (run (cat "run " pager-cmd) LICENSE-file (safe))
- (message "\nAmiTCP/IP is a copyrighted propiertary software of "
- "\"Network Solutions Development Inc.\"\n"
- "\nPlease read the shown license text carefully.\n"
- "\nBy proceeding the installation of this software you "
- "indicate that you accept the license conditions.\n\n"
- "Also note that you should fill in your registration card "
- "and post it.\n"
- )
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- select-destination-directory
- ;; Select destination directory for the installation.
- ;; This is the floppy install-version
- ;;
- (transcript "Selecting destination directory for the installation.")
- (set atcp-dest
- (askdir
- (prompt "Select directory where to install\nthe " app-name "."
- pretend-extra)
- (help " Here you can specify location where to install "
- "the " app-name ".\n"
- " Installation must NOT be made on top of an older "
- "version of the " @app-name ".\n"
- " Installer will create a subdirectory called `"
- app-dir-name "' to the selected directory and copy the "
- @app-name " files to it.")
- (newpath)
- (default
- (if (= 2 (exists "Work:" (noreq)))
- "Work:"
- (cat (getdevice "SYS:") ":")))
- ))
- (textfile (dest (tackon atcp-dest (cat app-dir-name ".info")))
- (include info.AmiTCPdir-file))
- (set atcp-dest (tackon atcp-dest app-dir-name))
- (if (= pretend 0) (set @default-dest atcp-dest))
- (makedir atcp-dest (infos))
- (message app-name " will be installed in:\n\n" atcp-dest)
-
- ;; Make the AmiTCP: assign
- (if (= @pretend 0)
- ((makeassign atcp-name atcp-dest)
- (if (NOT (= 2 (exists (tackon atcp-assign "devs"))))
- (makedir (tackon atcp-assign "devs")))))
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; This is floppy-install version
- ;;
- ;; arguments:
- ;;
- ;; unpkt-source - the source archive
- ;; unpkt-destination - the destination directory
- ;; unpkt-sdp - number of directories to strip
- ;; unpkt-title-name - descriptive name of the archive
- ;; unpkt-title-not - installation unit name
-
-
- (procedure
- run-unpkt
- ;;
- (if (exists unpkt-source)
- ((transcript "Dearchiving " unpkt-source " files to " unpkt-destination ".")
- (working "Writing files to " unpkt-destination "...")
- (if (= @pretend 0)
- ((if (run (cat unpkt-cmd " "
- "\"" unpkt-source "\" "
- "\"" unpkt-destination "\""
- " SDP=" unpkt-sdp
- " >\"CON:9/9/600/100/UnPkt Output/INACTIVE/AUTO\" "))
- (abort " UnPkt could not dearchive the " unpkt-source ". "
- "This may be due to:\n"
- " 1) Not enough disk space\n"
- " 2) Not enough memory\n"
- " 3) Corrupted archive\n"
- " 4) Corrupted UnPkt\n"))))
- 1)
- ((transcript unpkt-source " could not be located, and is NOT installed!")
- (message "\nWARNING\n\n"
- "Could not locate the " unpkt-title-name " archive.\n"
- unpkt-title-not " is NOT installed!")
- 0))
- )
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; This is floppy-install version
- ;;
- (procedure
- copy-files-to-destination ;;; UnPkt AmiTCP/IP files to the destination
- ;;
-
- (set
- unpkt-source AmiTCP-pkt-file
- unpkt-destination atcp-dest
- unpkt-sdp 1
- unpkt-title-name "AmiTCP/IP program"
- unpkt-title-not "AmiTCP/IP"
- )
- (if (run-unpkt)
- (
- ;;
- ;; Copy the Installer
- ;;
- (copyfiles
- (source Installer-file)
- (dest bin-dir)
- (files)
- (infos))
-
- ;;
- ;; Create AmiTCP:log if it does not exist already
- ;;
- (if (NOT (= 2 (exists (tackon atcp-assign "log"))))
- (makedir (tackon atcp-assign "log")))
- ;;
- ;; Create AmiTCP:log/wtmp if it does not exist already
- ;;
- (if (NOT (= 1 (exists (tackon atcp-assign "log/wtmp"))))
- (textfile (dest (tackon atcp-assign "log/wtmp"))))
-
- (copy-providers)
-
- ;; AmiTCP/IP program archive installed succesfully
- 1)
- 0))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- copy-providers
- (transcript "Copying provider files.")
- ;;
- ;; Create directory AmiTCP:providers if it does not exist already
- ;;
- (set tmp-var (tackon atcp-assign "providers"))
- (if (NOT (= 2 (exists tmp-var)))
- (makedir tmp-var))
- (copyfiles
- (prompt "Copying provider files")
- (source dist-providers-dir)
- (dest tmp-var)
- (all)
- (optional "nofail"))
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- update-devices
- (transcript "Updating Sana-II device drivers.")
- ;;
- ;; Create directory DEVS:Networks if it does not exist already
- ;;
- (if (NOT (= 2 (exists "DEVS:Networks")))
- (makedir "DEVS:Networks"))
- ;;
- ;; Copy each driver in the distribution to the DEVS:Networks if necessary
- ;;
- (working "Checking Sana-II device drivers...")
- (if (= 2 (exists dist-networks-dir))
- (foreach
- dist-networks-dir "#?.device"
- ((set dist-name (tackon dist-networks-dir @each-name)
- devs-name (tackon "DEVS:Networks" @each-name)
- dist-version (getversion dist-name)
- copy-it (NOT (exists devs-name)))
- ;;
- ;; Check if the driver should be copied over
- ;;
- (if (NOT copy-it)
- (set copy-it
- ; or if the driver in DEVS:Networks is of older version
- (< (set devs-version (getversion devs-name)) dist-version)))
- (if (NOT copy-it)
- (set copy-it
- ; or if the files are of the same version but different
- (set sum-differs (if (= dist-version devs-version)
- (<> (getsum dist-name)
- (getsum devs-name))
- 0))))
- (if copy-it
- (copyfiles
- (prompt "Should this Sana-II driver be installed in Devs:Networks?\n"
- (if devs-version
- (cat "A driver with the same name exists already"
- (if sum-differs
- (cat ", it has the same version, but the "
- "files are not the same.")
- (cat ", but the driver in the "
- "DEVS:Networks is of older version.")))
- ""))
- (help
- " The Sana-II drivers should be located in "
- "the DEVS:Networks directory.\n"
- " This directory is the official location for the Sana-II "
- "device drivers.")
- (source (pathonly dist-name))
- (choices (fileonly dist-name))
- (dest "DEVS:Networks")
- (files)
- (optional "nofail" "askuser")
- (confirm "average")))))
- (message "No Sana-II drivers found on the installation disk")
- )
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- ask-update-devices
- (if (= 2 (exists dist-networks-dir))
- (if (askbool
- (prompt "\nDo you want to update your Sana-II network device "
- "drivers?\n"
- "Each copy will be confirmed.")
- (help
- " Each new AmiTCP/IP distribution usually contains "
- "updated versions of some of the provided Sana-II network "
- "device drivers. If you choose \"Yes\", this installation "
- "script will check for each device, if this is the case."))
- (update-devices)
- (transcript "User did not want to update Sana-II drivers."))
- (transcript "Directory " dist-networks-dir " not found.")))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; arguments:
- ;;
- ;; uus::commands - commands to add
- ;; uus::section - section name
- ;; uus::file - file name into which to save the changes if needed
- ;;
- (procedure
- update-user-startup
- (set uus::complete (cat ";BEGIN " uus::section "\n"
- uus::commands
- ";END " uus::section "\n"))
- (set startup-changed 1)
- (startup
- uus::section
- (command uus::commands)
- (prompt "Installer will modify your S:User-Startup file. "
- "Following lines will be appended to it:\n\n"
- uus::complete)
- (help " Installer needs to make indicated modifications to "
- "your user startup file.\n"
- " You should make modifications later by hand "
- "if you skip this part."))
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- ask-copy-old-configuration
- ;;
- ;; Copy old configuration files
- ;; Returns TRUE if AmiTCP does not need to be configured.
- ;; The reconfiguration is forced now.
- ;;
- (set
- edit-change-fingerd "t:edit-change-fingerd"
- old-conf-dir (tackon old-atcp-directory "db")
- old-devs-dir (tackon old-atcp-directory "devs")
- old-motd (tackon old-conf-dir "motd"))
- ;;
- ;; return version of the old AmiTCP detected
- ;;
- (procedure
- get-old-atcp-version
- (if (exists (tackon old-atcp-directory "AmiTCP") (noreq))
- (/ (getversion (tackon old-atcp-directory "AmiTCP")) 65536)
- 0))
- ;;
- (set old-atcp-version (get-old-atcp-version))
- ;;
-
- (procedure
- copy-rest-config
- (set ask-options-bitmap
- (askoptions
- (prompt
- "Select configuration files you want to copy from old configuration"
- "\nThe files you choose will be copied to the new configuration "
- "directory when you press `Proceed'")
- (help
- " You may copy your old configuration files or use untouched files "
- "came with the new distribution.\nAll the files mentioned may not"
- " be present in your current configuration.")
-
- (choices
- "AmiTCP.config"
- "autointerfaces"
- "group"
- "hosts"
- ; NO! "inetd.conf"
- "networks"
- "resolv.conf"
- "services"
- "protocols"
- "provider.conf"
- "passwd"
- "rpc"
- )))
-
- (set n 0)
- (while (set thisfile (select n
- "AmiTCP.config"
- "autointerfaces"
- "group"
- "hosts"
- ; NO! "inetd.conf"
- "networks"
- "resolv.conf"
- "services"
- "protocols"
- "provider.conf"
- "passwd"
- "rpc"
- ""))
- ((if (and (in ask-options-bitmap n)
- (exists (tackon old-conf-dir thisfile)))
- (copyfiles
- (prompt "Copying " thisfile " to " conf-dir)
- (source (tackon old-conf-dir thisfile))
- (dest conf-dir)
- (optional "nofail" "force")))
- )
- (set n (+ n 1))
- ))
-
- ;;
- (procedure
- copy-motd
- (if (exists old-motd)
- ((if (>= @user-level 2)
- (message "\nCopying file\n\n"
- old-motd "\n"
- "(Message Of The Day)\n"
- "\nto directory \"" conf-dir "\"."))
- (copyfiles
- (source old-motd)
- (dest conf-dir)
- (files)))))
- (procedure
- update-services
- (set service-file (tackon conf-dir "services"))
- (if (run (cat "search search \"amiganetfs\" quiet from " service-file)
- (safe))
- (;; Not found, add it
- (textfile (dest service-file)
- (include service-file)
- (append ";\n; Amiga specific services\n;\n"
- "amiganetfs 2500/tcp\n")
- (prompt
- "Do you want to add AmigaNetFS service to your "
- "service database?")
- (help
- " The " @app-name " includes NetFS, network file system "
- "between Amigas, by Timo Rossi. It is a TCP based protocol "
- "which requires both ends of connection have same service "
- "(TCP port) entries. If you already had NetFS installed "
- "you probably do not want to update your service "
- "database.")
- (confirm)))))
- (procedure
- update-hosts
- (set hosts-file (tackon conf-dir "hosts"))
- (if (run (cat "search search \"localhost\" quiet from " hosts-file)
- (safe))
- (;; Not found, add it
- (transcript "Adding 'localhost' entry to the db/hosts.")
- (textfile (dest hosts-file)
- (include hosts-file)
- (append ";\n; Entry for the localhost\n;\n"
- "127.0.0.1 localhost\n")
- ))))
- ;;
- (procedure
- update-napsaprefs
- (set old-napsaprefs
- (if (exists (tackon old-atcp-directory "db/NapsaPrefs") (noreq))
- (tackon old-atcp-directory "db/NapsaPrefs")
- (if (exists "s:NapsaPrefs")
- "s:NapsaPrefs")
- ""))
- (if old-napsaprefs
- (;;
- (copyfiles
- (source old-napsaprefs)
- (dest conf-dir)
- (files)
- (confirm)
- (prompt "\nUse your old Napsaterm preferences?")
- (help " Installer have found an existing NapsaPrefs file "
- old-napsaprefs ". You can copy it to new configuration "
- "directory.")))))
- (procedure
- note-additional
- (message
- "Your old AmiTCP/IP configuration files were copied from an old installation "
- "to the new. However, if you, or any of your installed programs, "
- "have added additional configuration files (in db/) or programs (in bin/), "
- "you need to transfer these to the new "
- "installation manually.\n")
- )
- (transcript "Ready to copy old configuration.")
- (if (askbool
- (default 1)
- (prompt
- "\nDo you want to use settings from an earlier installation?")
- (help
- " Installer have detected existing configuration "
- "directory \"" old-conf-dir "\" which "
- "can be used to configure the " app-name ". You can keep most "
- "of your previous configuration. This is important if you have "
- "installed extra applications.\n"
- " Configuration files will be "
- (if (> @user-level 1)
- "optionally")
- " copied.\n"))
- (
- (copy-rest-config)
- (copy-motd)
- (update-hosts)
- (update-services)
- (update-napsaprefs)
- (note-additional)
- 0) ;; FALSE if AmiTCP needs to be reconfigured
- 0))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (procedure
- install-napsaterm
- ;;
- ;; Install Napsaterm fonts
- ;;
- ;; Ask for directory to install fonts.
- (procedure
- ask-napsa-font-dir
- (askdir
- (prompt "Select directory where to install Napsaterm fonts.\n")
- (help " Here you can specify location where to install "
- "the Napsaterm font called `napsa'. "
- "This directory should be in your font path "
- "(i.e. some directory in the assign fonts:).")
- (newpath)
- (default "fonts:")))
-
- (set
- unpkt-source NapsaFonts-pkt-file
- unpkt-destination (ask-napsa-font-dir)
- unpkt-sdp 1
- unpkt-title-name "NapsaTerm fonts"
- unpkt-title-not "NapsaTerm special fonts"
- )
- (run-unpkt)
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (procedure
- ;;
- ;; Install passwd and group databases
- ;;
- install-user-databases
- (transcript "Installing user databases")
- (procedure get-mufs-version
- (set mufs-vernum (getversion "multiuser.library" (resident)))
- (set mufs-ver (/ mufs-vernum 65536))
- (set mufs-rev (- mufs-vernum (* ver 65536))))
- (procedure passwd-create
- (copyfiles
- (prompt "Copying " passwd-source " to AmiTCP:db/passwd.")
- (source passwd-source)
- (dest conf-dir)
- (newname "passwd")
- (optional "nofail")))
- (procedure group-create
- (copyfiles
- (prompt "Copying " group-source " to AmiTCP:db/group.")
- (source group-source)
- (dest conf-dir)
- (newname "group")
- (optional "nofail")))
-
- (set passwd-source (tackon conf-dir "passwd-example"))
- (set group-source (tackon conf-dir "group-example"))
- (if (>= @user-level 2)
- (message
- "\n"
- "Copying user database from file"
- "\n\n\"" passwd-source "\"\n\n"
- "and group database from file"
- "\n\n\"" group-source "\"\n\n"))
- (passwd-create)
- (group-create)
- )
-
- (procedure
- set-must-reboot
- (if (<> (getversion "netinf<o.device" (resident)) 0)
- ((set netinfo-temp-file "t:netinfo-expunge-script")
- (textfile (dest netinfo-temp-file)
- (append (cat
- "failat 5000\n"
- "avail flush >nil:\n"
- "avail flush >nil:\n"))
- (safe))
- (execute netinfo-temp-file)))
- (set netinfo-version (getversion "netinfo.device" (resident)))
- (if (AND (<> netinfo-version 0) ; exists
- (< netinfo-version 4)) ; and is old
- ((set must-reboot-after-install 1)
- (message "You seem to have some parts of an old " @app-name
- " installation running. Because of this the user "
- "database updating will have no effect before you reboot "
- "your Amiga.\n\n"
- "For this reason you _must_ reboot after the installation "
- "and before the \"Config AmiTCP\" is run."))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;
- ;;; Ask which parts to install
- ;;;
- ;;; on return following variables will have boolean values:
- ;;;
- ;;; do-install-amitcp
- ;;; do-install-drivers
- ;;; do-install-napsafonts
- ;;;
- (procedure
- ask-install-options
- (set
- install-options-bitmap
- (askoptions
- (prompt "Select parts to install:\n\n"
- "See the help for explanation on each item.")
- (choices "AmiTCP/IP"
- "Updated Sana-II network drivers"
- "NapsaTerm fonts"
- )
- (default %111)
- (help " AmiTCP/IP: "
- "The AmiTCP/IP itself. This includes binaries, documentation, "
- "help files and example configuration files.\n"
- " Updated Sana-II network drivers: "
- "If this option is checked, the Sana-II drivers in Devs:Networks "
- "will be updated. You will be asked for confirmation for each driver.\n"
- " NapsaTerm fonts: "
- "NapsaTerm has special fonts, that are sized 6×11 pixels and contain "
- "some special VT102 characters. They are suitable for interlaced "
- "screens. If you have normal NTSC or PAL screen, it might be better "
- "to not install these fonts but use Topaz/8 instead.\n"
- ))
- do-install-amitcp (in install-options-bitmap 0)
- do-install-drivers (in install-options-bitmap 1)
- do-install-napsafonts (in install-options-bitmap 2)
- ))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;
- ;;; Install AmiTCP/IP
- ;;;
- (procedure
- install-amitcp
- (select-destination-directory)
- (if (copy-files-to-destination) ; copy AmiTCP/IP files
- (
- ;; update user-startup
- (set uus::commands (cat "assign " atcp-assign " \"" atcp-dest "\"\n"
- "path " bin-dir " add\n"
- apipe-mount)
- uus::section @app-name
- uus::file (tackon atcp-assign "addition-to-user-startup"))
- (update-user-startup))
- ))
-
- ;;; copy "UnPkt" to RAM: if available
- ;;
- ;; If UnPkt is not found, then we are not started from the installation disk
- ;;
- ;;;
- (procedure
- set-unpkt-cmd
- (set unpkt-cmd
- (if (exists UnPkt-file)
- ((copyfiles
- (prompt "Copying packet dearchiver to RAM:")
- (source UnPkt-file)
- (dest "RAM:")
- (safe)
- (optional "nofail"))
- ; "echo")
- "RAM:UnPkt")
- "")))
-
- ;;;;;
- ;;
- ;; Launch Config AmiTCP
- ;;
- (procedure
- run-config-amitcp
- (set start-config-script "t:start-config-script")
- (textfile
- (dest start-config-script)
- (append
- ".key foo\n.bra {\n.ket }\n\n"
- "cd " atcp-assign "\n"
- "Stack 20000 ; Installer needs this\n"
- (tackon bin-dir "Installer")
- " SCRIPT \"Config AmiTCP\" APPNAME \"AmiTCP/IP\" LOGFILE config_log_file MINUSER AVERAGE\n"
- )
- (safe))
- (protect start-config-script "+s +e")
- (if (askbool
- (prompt "\nStart \"Config AmiTCP\" to configure the just "
- "installed " @app-name "?")
- (help @app-name " should be configured after the installation. "
- "If you do not want to do the configuration now, you must "
- "do it later by starting the \"Config AmiTCP\" from the "
- "WorkBench icon.\n"))
- (execute start-config-script)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;
- ;;; Installatation sequence
- ;;;
-
- ;;
- ;; Initialize "global" variables to default values (not complete)
- ;;
- (set
- startup-changed 0
- must-reboot-after-install 0
- )
-
- (complete 00) (transcript "On making " app-name ".")
- (complete 01) (check-user-level)
- (complete 02) (check-system-version)
- (complete 03) (check-available-memory)
- (complete 04) (check-old-assign)
- (complete 05) (check-cpu-type)
-
- ;; askdisk for the install-disk1-name?? maybe later...
-
- ;; show the README-FIRST file if it exists
- (if (exists README-FIRST-file)
- ((run (cat "run " pager-cmd " \"" README-FIRST-file "\" ") (safe))
- (message " Please read the shown \"Read Me First\" file carefully "
- "before continuing the installation.")))
-
- (set-unpkt-cmd)
- (if (= unpkt-cmd "")
- (abort " UnPkt command not present on the installation disk!"))
-
- (complete 08) (ask-accept-license) ;; ask if user accepts the license
- (complete 10) (ask-install-options)
- (complete 15) (if do-install-amitcp (install-amitcp))
- (complete 30) (if do-install-napsafonts (install-napsaterm))
- (complete 35) (if do-install-drivers (update-devices))
- (if do-install-amitcp ;; Ask if old configuration should be copied
- (
- (set-must-reboot)
- (set old-conf-used
- (if old-atcp-directory
- (if (exists (tackon old-atcp-directory "bin/startnet")
- (noreq))
- ((complete 40)
- (ask-copy-old-configuration)))))
- ;;
- ;; Install user databases if not copied from an old configuration
- ;;
- (if (exists (tackon conf-dir "passwd"))
- (transcript "There is already a user database.")
- ((complete 70)
- (install-user-databases))) ; install passwd/group
- ;;
- ;; Configure AmiTCP/IP is necessary
- ;;
- (complete 90)
- (if (AND (NOT must-reboot-after-install) (NOT old-conf-used))
- ;;
- ;; Spawn the installer on the "Config AmiTCP" with
- ;; correct options
- (run-config-amitcp)
- ;(configure-amitcp)
- )
- ))
- ;; show something
- (foreach atcp-assign "#?.readme"
- (run (cat "run " pager-cmd) (tackon atcp-assign @each-name)
- (safe)))
-
- ;;; All done!
- (complete 100)
- (exit (if startup-changed
- (cat "You should reboot your Amiga to enable the changes made "
- "to system startup files.")
- (cat "You must add the contents of the file(s) \""
- "addition-to-user-startup\" to your S:User-Startup and "
- "reboot before you can use " @app-name ".\n"))
- (if must-reboot-after-install
- (cat "\nYou MUST reboot before configuring " @app-name ". Start "
- "\"Config AmiTCP\" from WorkBench after the reboot "
- "to configure your new " @app-name " installation.\n")
- ))
-
- ;; EOF
- ;;
-